package javaSE.LibrarySystem.operation;

import javaSE.LibrarySystem.Book.Book;
import javaSE.LibrarySystem.Book.BookList;

public class FindOperation implements IOperation{
    public void work(BookList bookList){
        System.out.println("查找图书！");
        System.out.println("请输入你所要查找图书的名称：");
        String name = scanner.nextLine();
        int size = bookList.getUsedSize();
        for (int i = 0; i <size ; i++) {
            Book book = bookList.getBook(i);
            if (name.equals(book.getName())){
                System.out.println("你所查找书籍的信息如下：");
                System.out.println(book);
                return;
            }
        }
        System.out.println("没有查找到这本书籍");
    }
}
